/* 数据-业务员
 */

import { postRequest, getRequest, getDownload, uploadRequest } from '@/lib/axios'

export const salesmanApi = {
  // 业务员列表
  querySalesmanList: (param) => {
    return getRequest('/salesman/list', param)
  },
  // 业务员新增
  addSalesman: (param) => {
    return postRequest('/salesman/add', param)
  },
  // 业务员编辑
  editSalesman: (param) => {
    return postRequest('/salesman/edit', param)
  },
  // 业务员修改
  modifySalesman: (param) => {
    return postRequest('/salesman/modify', param)
  },
  // 业务员删除
  delSalesman: (param) => {
    return postRequest('/salesman/del', param)
  },
  // 业务员导出
  exportSalesman: (params) => {
    return getDownload('/salesman/export', params)
  },
  // 业务员绑定门店
  bindSalesman: (params) => {
    return postRequest('/salesman/bind', params)
  },
  // 业务员解绑门店
  unbindSalesman: (params) => {
    return postRequest('/salesman/unbind', params)
  },
  // 获取业务员未绑定的门店
  unboundSalesman: (params) => {
    return getRequest('/salesman/unbound', params)
  },
  // 导出
  exportXlsx: (params) => {
    return getDownload('/salesman/exportXlsx', params)
  },
  // 下载模版
  exportTpl: (params) => {
    return getDownload('/salesman/exportTpl', params)
  },
  // 导入
  importXlsx: (data) => {
    return uploadRequest('/salesman/importXlsx', data)
  }
}
